package com.gs.disk.service.admin.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gs.disk.dao.admin.UserDao;
import com.gs.entity.UserEntity;
import com.gs.disk.service.admin.LoginService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @title: 孙杨申
 * @date 2021/12/4 20:39
 */
@Service
public class LoginServiceImpl implements LoginService {


    @Resource
    private UserDao userDao;

    @Override
    public UserEntity getByName(String userName) {
        QueryWrapper<UserEntity> wrapper = new QueryWrapper<>();
        wrapper.eq("name",userName);
        return userDao.selectOne(wrapper);
    }


    @Override
    public UserEntity getById(Integer id) {
        return userDao.selectById(id);
    }

}
